package com.dailyblue.java.net.tcp.demo3;

import lombok.SneakyThrows;

import java.io.InputStream;

public class 读取 extends Thread {

    private InputStream in;

    public 读取(InputStream in) {
        this.in = in;
    }

    @SneakyThrows
    public void run() {
        byte[] bytes = new byte[10];
        while (true) {
            int len;
            while ((len = in.read(bytes)) != -1) {
                String v = new String(bytes, 0, len);
                System.out.print(v);
            }
        }
    }
}
